/**
 * Created by wry on 2014/12/15.
 */

module.exports = function (app) {
    var systems = require('../controllers/system-controller');

    logger.debug("load the systems-route module....");

    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getWeather/:longitude/:latitude/:token/:deviceId', systems.getWeather);

    app.post('/rest/' + RESTFullServiceVersion + '/Systems/createBanner/:token/:deviceId', systems.createBanner);
    app.post('/rest/' + RESTFullServiceVersion + '/Systems/uploadBannerBgImages/:bannerObjId/:token/:deviceId', systems.uploadBannerBgImages);
    app.put('/rest/' + RESTFullServiceVersion + '/Systems/updateBanner/:bannerObjId/:token/:deviceId', systems.updateBanner);
    app.delete('/rest/' + RESTFullServiceVersion + '/Systems/deleteBanner/:bannerObjId/:token/:deviceId', systems.deleteBanner);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getBanner/:stickyPage/:token/:deviceId', systems.getBanner);

    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getMyMessageList/:pageNo/:token/:deviceId', systems.getMyMessageList);

    //获取运营推送消息列表
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getOperateMessage/:pageNo/:token/:deviceId', systems.getOperateMessage);

    app.get('/rest/' + RESTFullServiceVersion + '/Systems/emptyMyMessage/:token/:deviceId', systems.emptyMyMessage);

    //清空运营推送消息
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/emptyOperateMessage/:token/:deviceId', systems.emptyOperateMessage);

    //清空未读消息
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/emptyUnReadMessage/:token/:deviceId', systems.emptyUnReadMessage);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/emptyUnReadOperateMessage/:token/:deviceId', systems.emptyUnReadOperateMessage);

    //设置离线消息已读
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/setOfflineMessageAsRead/:huanxinId/:token/:deviceId', systems.setOfflineMessageAsRead);

    //删除单条消息
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/deleteReplyMessage/:id/:token/:deviceId', systems.deleteReplyMessage);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/deleteOperateMessage/:id/:token/:deviceId', systems.deleteOperateMessage);

    app.get('/rest/' + RESTFullServiceVersion + '/Systems/setMessageAsRead/:questionId/:token/:deviceId', systems.setMessageAsRead);
    //设置运营推送消息已读
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/setOperateMessageAsRead/:messageId/:clickSource/:token/:deviceId', systems.setOperateMessageAsRead);

    app.post('/rest/' + RESTFullServiceVersion + '/Systems/postFeedback/:token/:deviceId', systems.postFeedback);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getMessageChatList/:token/:deviceId', systems.getMessageChatList);

    //环信IM接口操作
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/im/getChatmessages', systems.getMessageChatList);


    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getHotKeywords/:token/:deviceId', systems.getHotKeywords);
    //专题
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getDetailOfSpecialTopic/:topicId/:token/:deviceId', systems.getDetailOfSpecialTopic);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getTopicReply/:topicId/:pageNo/:token/:deviceId', systems.getTopicReply);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getSpecialTopicList/:pageNo/:token/:deviceId', systems.getSpecialTopicList);
    app.post('/rest/' + RESTFullServiceVersion + '/Systems/postSpecialTopicComment/:token/:deviceId', systems.postSpecialTopicComment);

    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getAppConfig/:deviceId', systems.getAppConfig);

    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getQiniuToken/:deviceId', systems.getQiniuToken);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/getQiniuWebpToken/:deviceId', systems.getQiniuWebpToken);

    //后台发布专题
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/postSpecialTopic', systems.postSpecialTopic);


    app.post('/rest/' + RESTFullServiceVersion + '/Systems/uploadImages', systems.uploadImages);
    app.post('/rest/' + RESTFullServiceVersion + '/Systems/oldUploadImages', systems.oldUploadImages);

    app.post('/rest/' + RESTFullServiceVersion + '/Systems/postAppStartInfo/:deviceId', systems.postAppStartInfo);
    app.post('/rest/' + RESTFullServiceVersion + '/Systems/postDeviceInfo/:deviceId', systems.postDeviceInfo);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/searchTerms/:keyword/:token/:deviceId', systems.searchTerms);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/searchQuestionAndReply/:keyword/:token/:deviceId', systems.searchQuestionAndReply);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/searchTopic/:keyword/:token/:deviceId', systems.searchTopic);
    //新版搜索
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/globalSearch/:keyword/:token/:deviceId', systems.globalSearch);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/searchUser/:keyword/:page/:token/:deviceId', systems.searchUser);
    app.get('/rest/' + RESTFullServiceVersion + '/Systems/searchUgc/:keyword/:page/:token/:deviceId', systems.searchUgc);
    //1.6.0搜索
    app.post('/rest/' + RESTFullServiceVersion + '/Systems/searchAppUgc/:page/:token/:deviceId', systems.searchAppUgc);

    //系统后台管理路由
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getShortMessageList', systems.getShortMessageList);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/searchShortMessage', systems.searchShortMessage);

    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getChatMessageList', systems.getChatMessageList);//IM聊天记录搜索
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/searchChatMessage', systems.searchChatMessage);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/searchChatLogByTwoUser', systems.searchChatLogByTwoUser);

    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/interest22/:inputFrom', systems.getInterestList22);
    /*个性化推荐效果分析*/
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/interestGeorge', systems.interestGeorge);


    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/sendMessageByCustom', systems.sendMessageByCustom);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getFeedbackList/:communityId', systems.getFeedbackList);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/createSpecialNews', systems.createSpecialNews);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/removeNews/:newsId', systems.removeNews);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getSpecialNewsList/:communityId', systems.getSpecialNewsList);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/confirmOrder', systems.confirmOrder);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getPushUserList', systems.getPushUserList);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/confirmPush', systems.confirmPush);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getAllCommunityTopic/:communityId/:status', systems.getAllCommunityTopic);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getTopicById/:id', systems.getTopicById);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/setTopicStatus', systems.setTopicStatus);

    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getAllCommunityStatistics', systems.getAllCommunityStatistics);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getNotActiveUser/:communityId', systems.getNotActiveUser);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getCommunityActivityList/:communityId', systems.getCommunityActivityList);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/deleteTopic/:id', systems.deleteTopic);

    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/generateAllTopics', systems.generateAllTopics);

    app.get('/sms/rt', systems.acceptSmsRt);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/shortUrl', systems.shortUrl);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/generatePromotionCode', systems.generatePromotionCode);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getPromotionCodeList', systems.getPromotionCodeList);
    app.get('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getPromotionCodeDateCreated', systems.getPromotionCodeDateCreated);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/setPromotionCodeOwner', systems.setPromotionCodeOwner);

    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/receiveOfflineMessage', systems.receiveOfflineMessage);
    app.post('/rest/' + RESTFullServiceVersion + '/Systems/appErrorLog/:deviceId', systems.appErrorLog);
    app.post('/rest/' + RESTFullServiceVersion + '/backoffice/Systems/getAppErrorLogList', systems.getAppErrorLogList);

    //1.6.0
    app.delete('/rest/' + RESTFullServiceVersion + '/topic/reply/:topicId/:replyId/:token/:deviceId', systems.deleteTopicReply);

    //app.get('/group*/*', systems.redirectQiNiu);


    app.get('/rest/' + RESTFullServiceVersion + '/System/userToken/:mobilePhone', systems.getUserToken);

    //1.7.0
    app.post('/rest/' + RESTFullServiceVersion + '/topic/comment/:token/:deviceId', systems.addTopicComment);

    app.post('/rest/' + RESTFullServiceVersion + '/test',systems.test);

    app.get('/rest/' + RESTFullServiceVersion + '/test1',systems.test1)
    app.get('/rest/' + RESTFullServiceVersion + '/test2',systems.test2)

    /*  宝宝树66小区五期 环信    add  登陆极验证 guo.xiaomin  20171117   start   */
    // 1120-commit-master
    // 直接获取发给小6客服的环信信息
    app.post('/rest/' + RESTFullServiceVersion + '/Systems/saveChatMessages/:token/:deviceId', systems.saveHxChatMessages);
    /*  宝宝树66小区五期 环信    add  登陆极验证 guo.xiaomin  20171117   end   */

};